/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ServerAdmin.java
 *
 * Created on 26.07.2011, 18:20:05
 */
package de.develop.gui;

import de.develop.enums.DebugTypes;
import de.develop.server.GameServer;
import java.awt.Font;

/**
 *
 * @author Phillip
 */
public class ServerAdminGUI extends javax.swing.JFrame
{

    private GameServer gameServer;

    public ServerAdminGUI()
    {
    }

    /** Creates new form ServerAdmin */
    public ServerAdminGUI( GameServer gameServer )
    {
        initComponents();
        myInit();        
        this.gameServer = gameServer;

    }

    public void write( DebugTypes debugType, String msg )
    {
        switch ( debugType )
        {
            case MAIN:
                taMain.append( msg + "\n" );
                break;
            case GAME_SCHEDULER:
                taGameScheduler.append( msg + "\n" );
                break;
            default:
                break;
        }

    }

    private void myInit()
    {
        final int fontSize = 11;  
        taGameScheduler.setEditable( false);
        taGameScheduler.setFont(new Font("Monospaced", Font.PLAIN, fontSize ));  
        taMain.setEditable( false);
        taMain.setFont(new Font("Monospaced", Font.PLAIN, fontSize ));  
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings( "unchecked" )
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tpGame = new javax.swing.JTabbedPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        taMain = new javax.swing.JTextArea();
        jScrollPane3 = new javax.swing.JScrollPane();
        taGameScheduler = new javax.swing.JTextArea();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        taMain.setColumns(20);
        taMain.setRows(5);
        jScrollPane1.setViewportView(taMain);

        tpGame.addTab("Main", jScrollPane1);

        taGameScheduler.setColumns(20);
        taGameScheduler.setRows(5);
        jScrollPane3.setViewportView(taGameScheduler);

        tpGame.addTab("GameScheduler", jScrollPane3);

        jMenu1.setText("File");

        jMenuItem1.setText("Exit");
        jMenu1.add(jMenuItem1);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(352, Short.MAX_VALUE)
                .addComponent(tpGame, javax.swing.GroupLayout.PREFERRED_SIZE, 453, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(tpGame, javax.swing.GroupLayout.PREFERRED_SIZE, 487, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(14, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTextArea taGameScheduler;
    private javax.swing.JTextArea taMain;
    private javax.swing.JTabbedPane tpGame;
    // End of variables declaration//GEN-END:variables
}
